package com.oocl.util;

import com.oocl.service.impl.UserManagerImpl;

public class InstanceFactory {
	
	@SuppressWarnings("unchecked")
	public static <T> T newInstance(Class<T> instanceClass){
		Object obj=null;
		try {
			obj=instanceClass.newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return (T)obj;
	}
	
	public static void main(String[] args) {
		System.out.println(InstanceFactory.newInstance(UserManagerImpl.class));
	}
}
